#ifndef MOORE_1_H
#define MOORE_1_H


#include <vector>
#include "grid.h"

namespace mn
{

    std::vector<int> neighbours(Grid* (&g),const int& i,const int& j)
    {

        std::vector<int> v;
        int width=g->size(0);
        int height=g->size(1);

        if(i>0)v.push_back(g->get(i-1,j));//N
        else v.push_back(-1);
        if(j<width-1 && i>0)v.push_back(g->get(i-1,j+1));//NE
        else v.push_back(-1);
        if(j<width-1)v.push_back(g->get(i,j+1));//E
        else v.push_back(-1);
        if(j<width-1 && i<height-1)v.push_back(g->get(i+1,j+1));//SE
        else v.push_back(-1);
        if(i<height-1)v.push_back(g->get(i+1,j));//S
        else v.push_back(-1);
        if(j>0 && i<height-1)v.push_back(g->get(i+1,j-1));//SW
        else v.push_back(-1);
        if(j>0)v.push_back(g->get(i,j-1));//W
        else v.push_back(-1);
        if(i>0 && j>0)v.push_back(g->get(i-1,j-1));//NW
        else v.push_back(-1);
        return v;
    }
}
#endif // MOORE_1_H
